Failed at linking C++ [undefined reference boost::filesystem3 ... ]

Posted by Pphax on Stack Overflow See other posts from Stack Overflow or by Pphax
Published on 2011-11-25T01:34:32Z Indexed on 2011/11/25 1:50 UTC
Read the original article Hit count: 189

Filed under:
|
|
|

i'm having some troubles compiling my work, i'm using ubuntu with g++! i get a lot of these messages:

undefined reference to `boost::filesystem3::directory_entry::m_get_status(boost::system::error_code*) const'
undefined reference to `boost::filesystem3::path::extension() const'
undefined reference to `boost::filesystem3::path::filename() const'
undefined reference to `boost::filesystem3::path::filename() const'

(etc...)

I've searched and found maaany answers but none of those work for me.

[...]

-lboost_system (/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libboost_system.so)
-lboost_filesystem (/usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/libboost_filesystem.so)

[...] (when linking it shows those two libraries, i'm guessing the error is related to the second one.

hax@lap:~$ locate libboost_filesystem.so
/home/hax/boost_1_47_0/bin.v2/libs/filesystem/build/gcc-4.4.5/release/threading-multi/libboost_filesystem.so.1.47.0
/home/hax/boost_1_47_0/stage/lib/libboost_filesystem.so
/home/hax/boost_1_47_0/stage/lib/libboost_filesystem.so.1.47.0
/usr/lib/libboost_filesystem.so
/usr/lib/libboost_filesystem.so.1.42.0
/usr/local/lib/libboost_filesystem.so
/usr/local/lib/libboost_filesystem.so.1.47.0

this is the related line on my makefile:

-L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -L../boost/lib/ -lbncsutil -lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time -lboost_thread -lboost_system -lboost_filesystem  -Wl -t

I tried pointing with -L several different places where i saw filesystem.so was located but it didn't work!

Can anyone see the problem in those lines? if you need me to put some extra data i'll do it, i'm not seeing the problem :(

Thanks :)

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost